<?php
class UserAction extends PublicAction{
	public function index(){
		
	}
	//用户修改资料 
	public function upUserData(){
		if ($this->isLogin()){
			//dump($_POST);
			if ($_GET["setps"]=="base"){
				//基础数据
				$birthday=$_POST["birthdayYear"]."-".$_POST["birthdayMonth"]."-".$_POST["birthdayDay"];
				$data=array(
						"sex"=>intval($_POST["sex"]),
						"mobile_phone"=>intval($_POST["mobile_phone"]),
						"truename"=>mysql_escape_string($_POST["truename"]),
						"address"=>mysql_escape_string($_POST["address"]),
						"birthday"=>mysql_escape_string(ltrim($birthday)),
						"Info"=>mysql_escape_string($_POST["Info"])
				);
				$user=D("Users");
				$where=array(
						"user_id"=>$this->isLogin()
						);
				if ($user->where($where)->data($data)->save()){
					$url=empty($_GET["url"])?$_POST["url"]:$_GET["url"];
					if ($url){
						URLS(urldecode($url));
					}
					JSON(1,"数据更新成功",1);
				}else{
					JSON(0,"数据更新失败".$user->getLastSql(),0);
				}
				
			}
			
		}else{
			JSON(0,"登录超时",0);
		}
	}
	
}
?>